
<?php	
	
	class gifcard extends database
	{
		var $connection = '';	

		function gifcard()
		{
			parent::database();
		}
	
		function GetListPaging()
		{						
			$this->setQuery("set names utf8");
			$this->query();
			return $sql = "Select * from vnf_giftcard";			
		}
		
		function GetList()
		{						
			$this->setQuery("set names utf8");
			$this->query();
			$sql = "Select * from vnf_giftcard";			
					
			$this->setQuery($sql);
			$value = $this->loadAllRow();
			return $value;
		}
        
	/*	function AddGifcard($code, $name, $order)
		{
			$this->setQuery("set names utf8");
			$this->query();
			$sql = "Insert into vnf_giftcard(`country_code`, `country_name`, `order`) values('".$code."', '".$name."', '".$order."')";
            //echo $sql;
			$this->setQuery($sql);
			$this->query();
		}*/
		
		function UpdateGifcard( $id, $ActiveYN)
		{
			$this->setQuery("set names utf8");
			$this->query();
			$sql = "";
			$sql = "Update vnf_giftcard set `ActiveYN`='".$ActiveYN."'";
			$sql .= " where GiftCardID=".$id;			
		
			$this->setQuery($sql);
			$this->query();
		}
		
		function GetOneGifcard($id)
		{
			$this->setQuery("set names utf8");
			$this->query();
			$sql = "Select * from vnf_giftcard where GiftCardID=".$id." ";
			$this->setQuery($sql);
			$row = $this->loadOneRow();
			return $row;
		}
		
		function DeleteGifcard($id)
		{
			$this->setQuery("set names utf8");
			$this->query();
			$sql = "";
			$sql = "Delete from vnf_giftcard";
			$sql .= " where GiftCardID=".$id;			
			
			$this->setQuery($sql);
			$this->query();
		}
		
	}
?>